﻿// Autore: Alessio Parma

using System;
using System.Collections.Generic;

namespace RecipesManager.Data
{
    static class Loader
    {
        static readonly Tuple<string, string[]>[] DefaultCategories = new[]
        {
            Tuple.Create("Carboidrati", new string[0]),
            Tuple.Create("Carni", new string[0]),
            Tuple.Create("Cereali e derivati", new string[0]),
            Tuple.Create("Condimenti", new string[0]),
            Tuple.Create("Fiume", new string[0]),
            Tuple.Create("Frutta", new string[0]),
            Tuple.Create("Funghi", new string[0]),
            Tuple.Create("Grassi", new string[0]),
            Tuple.Create("Latticini", new string[0]),
            Tuple.Create("Liquori", new string[0]),
            Tuple.Create("Mare", new string[0]),
            Tuple.Create("Proteine", new string[0]),           
            Tuple.Create("Verdure e ortaggi", new string[0]),
            
            Tuple.Create("Carni fresche", new[] {"Carni"}),
            Tuple.Create("Carni conservate", new[] {"Carni"}),
            Tuple.Create("Crostacei freschi", new[] {"Carni"}),
            Tuple.Create("Dolci", new[] {"Carboidrati", "Grassi"}),
            Tuple.Create("Formaggi", new[] {"Latticini"}),
            Tuple.Create("Frattaglie", new[] {"Carni"}),
            Tuple.Create("Frutta fresca", new[] {"Frutta"}),
            Tuple.Create("Frutta secca", new[] {"Frutta"}),
            Tuple.Create("Frutta esotica", new[] {"Frutta"}),
            Tuple.Create("Grassi animali", new[] {"Grassi"}),
            Tuple.Create("Grassi vegetali", new[] {"Grassi"}),
            Tuple.Create("Latte", new[] {"Latticini"}),
            Tuple.Create("Legumi", new[] {"Proteine", "Verdure e ortaggi"}),
            Tuple.Create("Molluschi freschi", new[] {"Carni"}),
            Tuple.Create("Pesce fresco", new[] {"Carni"}),
            Tuple.Create("Pesce conservato", new[] {"Carni"}),
            Tuple.Create("Pesce surgelato", new[] {"Carni"}),
            Tuple.Create("Selvaggina da penna", new[] {"Carni"}),
            Tuple.Create("Selvaggina da pelo", new[] {"Carni"}),
            Tuple.Create("Uova", new[] {"Proteine"}),
            
            Tuple.Create("Legumi freschi", new[] {"Legumi"}),
            Tuple.Create("Legumi secchi", new[] {"Legumi"}),
            Tuple.Create("Oli", new[] {"Grassi vegetali"}),
            Tuple.Create("Salumi", new[] {"Carni conservate"})                         
        };

        static readonly Tuple<string, string, DateTime>[] DefaultEvents = new[]
        {
            Tuple.Create("Pasqua", "Ci vorranno tante uova di cioccolato!", new DateTime(2013, 03, 31)),
            Tuple.Create("Pranzo di Natale", "Meglio tenersi leggeri...", new DateTime(2013, 12, 25)),
            Tuple.Create("Ultimo dell'anno", "Prepare le tartine :)", new DateTime(2013, 12, 31))
        };

        static readonly Tuple<string, MeasureType, string[]>[] DefaultIngredients = new[]
        {
            // Cereali e derivati
            Tuple.Create("Biscotti al burro", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Biscotti all'uovo (savoiardi)", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Biscotti per l'infanzia", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Biscotti ricoperti di cioccolato", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Biscotti secchi", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Biscotti wafer", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Brioche", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Crackers salati", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Farina d'avena", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Farina di frumento integrale", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Farina di frumento tipo 0", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Farina di frumento tipo 00", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Farina di mais", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Farina d'orzo", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Farina di riso", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Farina di segale", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Farro", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Fette biscottate", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Fette biscottate dolci", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Fette biscottate integrali", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Fiocchi d'avena", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Fiocchi di mais", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Fiocchi di riso", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Grissini", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Grissini all'olio", MeasureType.Unit, new[] {"Cereali e derivati"}),
            Tuple.Create("Orzo perlato", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Pane di tipo 1", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Pane di tipo 0", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Pane di tipo 00", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Pane di tipo integrale", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Pane francese", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Panini al latte", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Panini all'olio", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Pasta all'uovo", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Pasta di semola", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Pasta glutinata", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Polenta", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Risone (o riso grezzo)", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Riso brillato", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Riso mercantile", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Riso sbramato (semigrezzo)", MeasureType.Weight, new[] {"Cereali e derivati"}),
            Tuple.Create("Semola di frumento", MeasureType.Weight, new[] {"Cereali e derivati"}),

            // Carni fresche
            Tuple.Create("Agnello", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Anatra domestica", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Capretto", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Castrato", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Cavallo", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Coniglio", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Faraona petto", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Faraona coscia", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Gallina", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Lumaca", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Maiale", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Oca", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Pollo petto", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Pollo coscia", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Rana", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Tacchino petto", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Tacchino coscia", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Tacchino ala", MeasureType.Weight, new[] {"Carni fresche"}),
            Tuple.Create("Vitello", MeasureType.Weight, new[] {"Carni fresche"}),

            // Carni conservate
            Tuple.Create("Bovino lessato in gelatina", MeasureType.Weight, new[] {"Carni conservate"}),
            Tuple.Create("Cotechino", MeasureType.Weight, new[] {"Carni conservate"}),
            Tuple.Create("Salsiccia", MeasureType.Weight, new[] {"Carni conservate"}),
            Tuple.Create("Zampone", MeasureType.Weight, new[] {"Carni conservate"}),
            Tuple.Create("Wurstel", MeasureType.Weight, new[] {"Carni conservate"}),
            
            // Salumi
            Tuple.Create("Coppa", MeasureType.Weight, new[] {"Salumi"}),
            Tuple.Create("Mortadella", MeasureType.Weight, new[] {"Salumi"}),
            Tuple.Create("Pancetta", MeasureType.Weight, new[] {"Salumi"}),
            Tuple.Create("Prosciutto cotto", MeasureType.Weight, new[] {"Salumi"}),
            Tuple.Create("Prosciutto crudo", MeasureType.Weight, new[] {"Salumi"}),
            Tuple.Create("Salame", MeasureType.Unit, new[] {"Salumi"}),
            Tuple.Create("Speck", MeasureType.Weight, new[] {"Salumi"}),
            
            // Frattaglie
            Tuple.Create("Cervella di bovino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Coratella di agnello", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Coratella di vitello", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Cuore di bovino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Cuore di ovino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Cuore di suino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Fegatini di pollo", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Fegato di bovino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Fegato di ovino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Fegato di suino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Lingua di bovino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Milza di bovino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Polmone di bovino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Rene di bovino", MeasureType.Weight, new[] {"Frattaglie"}),
            Tuple.Create("Trippa di bovino", MeasureType.Weight, new[] {"Frattaglie"}),

            // Selvaggina da penna
            Tuple.Create("Anatra selvatica", MeasureType.Weight, new[] {"Selvaggina da penna"}),
            Tuple.Create("Fagiano", MeasureType.Weight, new[] {"Selvaggina da penna"}),
            Tuple.Create("Fringuello", MeasureType.Weight, new[] {"Selvaggina da penna"}),
            Tuple.Create("Allodola", MeasureType.Weight, new[] {"Selvaggina da penna"}),
            Tuple.Create("Pernice", MeasureType.Weight, new[] {"Selvaggina da penna"}),
            Tuple.Create("Quaglia", MeasureType.Weight, new[] {"Selvaggina da penna"}),
            Tuple.Create("Starna", MeasureType.Weight, new[] {"Selvaggina da penna"}),
            Tuple.Create("Piccione selvatico", MeasureType.Weight, new[] {"Selvaggina da penna"}),
            Tuple.Create("Struzzo", MeasureType.Weight, new[] {"Selvaggina da penna"}),
            Tuple.Create("Tordo", MeasureType.Weight, new[] {"Selvaggina da penna"}),

            // Selvaggina da pelo
            Tuple.Create("Camoscio", MeasureType.Weight, new[] {"Selvaggina da pelo"}),
            Tuple.Create("Cervo", MeasureType.Weight, new[] {"Selvaggina da pelo"}),
            Tuple.Create("Capriolo", MeasureType.Weight, new[] {"Selvaggina da pelo"}),
            Tuple.Create("Daino", MeasureType.Weight, new[] {"Selvaggina da pelo"}),
            Tuple.Create("Cinghiale", MeasureType.Weight, new[] {"Selvaggina da pelo"}),
            Tuple.Create("Coniglio selvatico", MeasureType.Weight, new[] {"Selvaggina da pelo"}),
            Tuple.Create("Lepre", MeasureType.Weight, new[] {"Selvaggina da pelo"}),

            // Pesce fresco
            Tuple.Create("Acciuga", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Alice", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Anguilla di mare", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),           
            Tuple.Create("Cefalo", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Dentice", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Nasello", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Palombo", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Razza", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Rombo", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Salmone", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Sarda", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Sgombro", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Sogliola", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Spigola", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Branzino", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Tonno", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),
            Tuple.Create("Triglia", MeasureType.Weight, new[] {"Pesce fresco", "Mare"}),        
            Tuple.Create("Storione", MeasureType.Weight, new[] {"Pesce fresco", "Fiume"}),
            Tuple.Create("Latterini", MeasureType.Weight, new[] {"Pesce fresco", "Fiume"}),
            Tuple.Create("Luccio", MeasureType.Weight, new[] {"Pesce fresco", "Fiume"}),
            Tuple.Create("Trota", MeasureType.Weight, new[] {"Pesce fresco", "Fiume"}),
            Tuple.Create("Tinca", MeasureType.Weight, new[] {"Pesce fresco", "Fiume"}),
            Tuple.Create("Anguilla di fiume", MeasureType.Weight, new[] {"Pesce fresco", "Fiume"}),
            Tuple.Create("Carpa", MeasureType.Weight, new[] {"Pesce fresco", "Fiume"}),
            Tuple.Create("Persico", MeasureType.Weight, new[] {"Pesce fresco", "Fiume"}),
            
            // Crostacei freschi
            Tuple.Create("Aragosta", MeasureType.Weight, new[] {"Crostacei freschi", "Mare"}),
            Tuple.Create("Astice", MeasureType.Weight, new[] {"Crostacei freschi", "Mare"}),
            Tuple.Create("Gambero", MeasureType.Weight, new[] {"Crostacei freschi", "Mare"}),

            // Molluschi freschi
            Tuple.Create("Calamaro", MeasureType.Weight, new[] {"Molluschi freschi", "Mare"}),
            Tuple.Create("Mitilo", MeasureType.Weight, new[] {"Molluschi freschi", "Mare"}),
            Tuple.Create("Cozza", MeasureType.Weight, new[] {"Molluschi freschi", "Mare"}),
            Tuple.Create("Ostrica", MeasureType.Weight, new[] {"Molluschi freschi", "Mare"}),
            Tuple.Create("Seppia", MeasureType.Weight, new[] {"Molluschi freschi", "Mare"}),
            Tuple.Create("Vongola", MeasureType.Weight, new[] {"Molluschi freschi", "Mare"}),

            // Pesce surgelato
            Tuple.Create("Cernia surgelata", MeasureType.Weight, new[] {"Pesce surgelato", "Mare"}),
            Tuple.Create("Dentice surgelato", MeasureType.Weight, new[] {"Pesce surgelato", "Mare"}),
            Tuple.Create("Nasello surgelato", MeasureType.Weight, new[] {"Pesce surgelato", "Mare"}),
            Tuple.Create("Orata surgelata", MeasureType.Weight, new[] {"Pesce surgelato", "Mare"}),
            Tuple.Create("Sogliola surgelata", MeasureType.Weight, new[] {"Pesce surgelato", "Mare"}),
            Tuple.Create("Pesce spada surgelato", MeasureType.Weight, new[] {"Pesce surgelato", "Mare"}),

            // Pesce conservato
            Tuple.Create("Alici sott'olio", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Alici sotto sale", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Anguilla marinata", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Aringa affumicata", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Aringa marinata", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Aringa salata", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Baccalà ammollato", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Baccalà secco", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Filetti di baccalà", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Salmone in salamoia", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Salmone salato", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Sgombro in salamoia", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Stoccafisso ammollato", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Stoccafisso secco", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Tonno in salamoia", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),
            Tuple.Create("Tonno sott'olio", MeasureType.Weight, new[] {"Pesce conservato", "Mare"}),

            // Latte
            Tuple.Create("Latte di capra", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Latte di pecora", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Latte di vacca intero", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Latte di vacca parz. scremato", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Latte di vacca scremato", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Latte condensato zuccherato", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Latte in polvere intero", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Latte in polvere semiscremato", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Latte in polvere scremato", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Yogurt da latte intero", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Yogurt da latte parz. scremato", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Yogurt da latte scremato", MeasureType.Volume, new[] {"Latte"}),
            Tuple.Create("Yogurt doppia panna", MeasureType.Volume, new[] {"Latte"}),

            // Formaggi
            Tuple.Create("Bel paese", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Bitto", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Burrini", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Caciocavallo", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Caciotta romana", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Caciotta toscana", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Caciottina fresca", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Caprino", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Emmental", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Fior di latte", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Fontina", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Formaggini", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Gorgonzola", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Grana", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Groviera", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Mascarpone", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Mozzarella", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Panna", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Pecorino", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Provola", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Provola affumicata", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Provolone dolce", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Provolone piccante", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Ricotta", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Scamorza", MeasureType.Weight, new[] {"Formaggi"}),
            Tuple.Create("Stracchino", MeasureType.Weight, new[] {"Formaggi"}),

            // Oli
            Tuple.Create("Margarina", MeasureType.Weight, new[] {"Oli"}),
            Tuple.Create("Olio d'oliva", MeasureType.Volume, new[] {"Oli"}),
            Tuple.Create("Olio di semi vari", MeasureType.Volume, new[] {"Oli"}),

            // Grassi animali
            Tuple.Create("Burro", MeasureType.Weight, new[] {"Grassi animali"}),
            Tuple.Create("Lardo", MeasureType.Weight, new[] {"Grassi animali"}),
            Tuple.Create("Pancetta di maiale", MeasureType.Weight, new[] {"Grassi animali"}),
            Tuple.Create("Strutto", MeasureType.Weight, new[] {"Grassi animali"}),

            // Uova
            Tuple.Create("Uovo di gallina intero", MeasureType.Unit, new[] {"Uova"}),
            Tuple.Create("Uovo di gallina: albume", MeasureType.Unit, new[] {"Uova"}),
            Tuple.Create("Uovo di gallina: tuorlo", MeasureType.Unit, new[] {"Uova"}),
            Tuple.Create("Uovo di anatra", MeasureType.Unit, new[] {"Uova"}),
            Tuple.Create("Uovo di faraona", MeasureType.Unit, new[] {"Uova"}),
            Tuple.Create("Uovo di tacchina", MeasureType.Unit, new[] {"Uova"}),
            Tuple.Create("Uovo di struzzo", MeasureType.Unit, new[] {"Uova"}),

            // Legumi freschi
            Tuple.Create("Fagioli", MeasureType.Weight, new[] {"Legumi freschi"}),
            Tuple.Create("Fagiolini", MeasureType.Weight, new[] {"Legumi freschi"}),
            Tuple.Create("Fave", MeasureType.Weight, new[] {"Legumi freschi"}),
            Tuple.Create("Piselli", MeasureType.Weight, new[] {"Legumi freschi"}),

            // Legumi secchi
            Tuple.Create("Ceci", MeasureType.Weight, new[] {"Legumi secchi"}),
            Tuple.Create("Fagioli secchi", MeasureType.Weight, new[] {"Legumi secchi"}),
            Tuple.Create("Fave sgusciate", MeasureType.Weight, new[] {"Legumi secchi"}),
            Tuple.Create("Lenticchie", MeasureType.Weight, new[] {"Legumi secchi"}),
            Tuple.Create("Lupini deamarizzati", MeasureType.Weight, new[] {"Legumi secchi"}),
            Tuple.Create("Piselli secchi", MeasureType.Weight, new[] {"Legumi secchi"}),
            Tuple.Create("Soia", MeasureType.Weight, new[] {"Legumi secchi"}),

            // Verdure e ortaggi
            Tuple.Create("Aglio", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Asparagi di bosco", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Asparagi di campo", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Asparagi di serra", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Barbabietole rosse", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Bieta", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Broccoletti di rape", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Broccoli", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Carciofi", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Carote", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cavolfiore", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cavolo broccolo", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cavolini di Bruxelles", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cavolo cappuccio verde", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cavolo cappuccio rosso", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cetrioli", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cicoria", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cicoria da taglio (barba di frate)", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cipolle", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Cipolline", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Finocchi", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Fiori di zucca", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Foglie di rapa", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Funghi ovuli", MeasureType.Weight, new[] {"Verdure e ortaggi", "Funghi"}),
            Tuple.Create("Funghi porcini", MeasureType.Weight, new[] {"Verdure e ortaggi", "Funghi"}),
            Tuple.Create("Funghi prataioli", MeasureType.Weight, new[] {"Verdure e ortaggi", "Funghi"}),
            Tuple.Create("Invidia", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Lattuga", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Lattuga cappuccio", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Lattuga da taglio", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Melanzane", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Patate", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Patate novelle", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Peperoncini piccanti", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Peperoni dolci", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Pomodori da insalata", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Pomodori maturi", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Pomodori pelati", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Porri", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Prezzemolo", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Radicchio rosso", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Radicchio verde", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Rape", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Ravanelli", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Sedano", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Sedano rapa", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Spinaci", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Tartufo nero", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Zucca gialla", MeasureType.Weight, new[] {"Verdure e ortaggi"}),
            Tuple.Create("Zucchine", MeasureType.Weight, new[] {"Verdure e ortaggi"}),

            // Frutta fresca
            Tuple.Create("Albicocche", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Amarene", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Ananas", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Arance", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Arance (succo)", MeasureType.Volume, new[] {"Frutta fresca"}),
            Tuple.Create("Banane", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Cachi", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Cedri", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Ciliegie", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Cocomero", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Fichi", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Fichi India", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Fragole", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Lamponi", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Limoni", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Limoni (succo)", MeasureType.Volume, new[] {"Frutta fresca"}),
            Tuple.Create("Mandaranci", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Mandarini", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Melagrane", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Mele", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Mele cotogne", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Melone", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Mirtilli", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("More", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Nespole", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Pere", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Pesche", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Pompelmi", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Prugne", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Ribes", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Uva", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Olive verdi", MeasureType.Weight, new[] {"Frutta fresca"}),
            Tuple.Create("Olive nere", MeasureType.Weight, new[] {"Frutta fresca"}),

            // Frutta secca
            Tuple.Create("Arachidi", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Mandorle Dolci", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Nocciole", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Noce", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Pinoli", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Pistacchi", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Castagne", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Fichi secchi", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Noci", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Prugne secche", MeasureType.Weight, new[] {"Frutta secca"}),
            Tuple.Create("Uva secca", MeasureType.Weight, new[] {"Frutta secca"}),

            // Frutta esotica
            Tuple.Create("Alchechengi", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Avocado", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Babaco", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Cocco", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Dattero fresco", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Dattero secco", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Kiwi", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Litchi", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Mango", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Mangostan", MeasureType.Weight, new[] {"Frutta esotica"}),
            Tuple.Create("Papaya", MeasureType.Weight, new[] {"Frutta esotica"}),

            // Dolci
            Tuple.Create("Canditi", MeasureType.Weight, new[] {"Dolci"}),
            Tuple.Create("Cioccolato al latte", MeasureType.Weight, new[] {"Dolci"}),
            Tuple.Create("Cioccolato fondente", MeasureType.Weight, new[] {"Dolci"}),
            Tuple.Create("Cioccolato gianduia", MeasureType.Weight, new[] {"Dolci"}),
            Tuple.Create("Crema di nocciole e cacao", MeasureType.Weight, new[] {"Dolci"}),
            Tuple.Create("Marmellata", MeasureType.Weight, new[] {"Dolci"}),
            Tuple.Create("Miele", MeasureType.Weight, new[] {"Dolci"}),
            Tuple.Create("Uvetta", MeasureType.Weight, new[] {"Dolci"}),

            // Condimenti
            Tuple.Create("Basilico", MeasureType.Unit, new[] {"Condimenti"}),
            Tuple.Create("Cannella", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Pepe bianco", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Pepe nero", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Zafferano", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Sale", MeasureType.Weight, new[] {"Condimenti"}),        
            Tuple.Create("Zucchero", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Cacao amaro in polvere", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Fecola di patate", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Dadi da brodo", MeasureType.Unit, new[] {"Condimenti"}),
            Tuple.Create("Maionese", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Noce moscata", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Peperoncino", MeasureType.Weight, new[] {"Condimenti"}),
            Tuple.Create("Vaniglia", MeasureType.Weight, new[] {"Condimenti"}),

            // Liquori
            Tuple.Create("Vodka", MeasureType.Volume, new[] {"Liquori"}),
            Tuple.Create("Whisky", MeasureType.Volume, new[] {"Liquori"}),
            Tuple.Create("Rhum", MeasureType.Volume, new[] {"Liquori"}),  
            Tuple.Create("Birra", MeasureType.Volume, new[] {"Liquori"}),
            Tuple.Create("Brandy", MeasureType.Volume, new[] {"Liquori"}),
            Tuple.Create("Gin", MeasureType.Volume, new[] {"Liquori"}),
            Tuple.Create("Grappa", MeasureType.Volume, new[] {"Liquori"}),
            Tuple.Create("Vermut", MeasureType.Volume, new[] {"Liquori"}),
            Tuple.Create("Vino bianco", MeasureType.Volume, new[] {"Liquori"}),
            Tuple.Create("Vino rosso", MeasureType.Volume, new[] {"Liquori"}),
            Tuple.Create("Spumante", MeasureType.Volume, new[] {"Liquori"}),

            // Senza categoria...
            Tuple.Create("Acqua", MeasureType.Volume, new string[0]),                   
            Tuple.Create("Colla di pesce", MeasureType.Weight, new string[0])                   
        };

        static readonly Tuple<string, string, MeasureType, MeasureFamily, double>[] DefaultMeasures = new[] 
        {
            // None
            Tuple.Create("Quanto Basta", "q.b.", MeasureType.None, MeasureFamily.None, 1.0),
            // Unit
            Tuple.Create("Unità", "", MeasureType.Unit, MeasureFamily.None, 1.0),
            // Volume - USA
            Tuple.Create("Tazza", "cup", MeasureType.Volume, MeasureFamily.USA, 0.237),           
            Tuple.Create("Cucchiaio", "tbsp", MeasureType.Volume, MeasureFamily.USA, 0.015),
            Tuple.Create("Cucchiaino", "tsp", MeasureType.Volume, MeasureFamily.USA, 0.005),
            Tuple.Create("Gallone (Usa)", "gal", MeasureType.Volume, MeasureFamily.USA, 3.785412),
            Tuple.Create("Gill (Usa)", "gill", MeasureType.Volume, MeasureFamily.USA, 0.1182941),
            Tuple.Create("Oncia Liquida (Usa)", "fl oz", MeasureType.Volume, MeasureFamily.USA, 0.02957353),
            Tuple.Create("Pinta (Usa)", "pt", MeasureType.Volume, MeasureFamily.USA, 0.4731765),
            Tuple.Create("Quarto (Usa)", "qt", MeasureType.Volume, MeasureFamily.USA, 0.9463529),           
            // Volume - UK           
            Tuple.Create("Gallone (Uk)", "gal", MeasureType.Volume, MeasureFamily.UK, 4.546),
            Tuple.Create("Gill (Uk)", "gill", MeasureType.Volume, MeasureFamily.UK, 0.142),
            Tuple.Create("Oncia Liquida (Uk)", "fl oz", MeasureType.Volume, MeasureFamily.UK, 0.0284),
            Tuple.Create("Pinta (Uk)", "pt", MeasureType.Volume, MeasureFamily.UK, 0.568),
            Tuple.Create("Quarto (Uk)", "qt", MeasureType.Volume, MeasureFamily.UK, 1.1364),          
            // Volume - Metric
            Tuple.Create("Litri", "l", MeasureType.Volume, MeasureFamily.Metric, 1.0),
            Tuple.Create("Centilitri", "cl", MeasureType.Volume, MeasureFamily.Metric, 0.01),
            Tuple.Create("Decilitri", "dl", MeasureType.Volume, MeasureFamily.Metric, 0.1),         
            Tuple.Create("Millilitri", "ml", MeasureType.Volume, MeasureFamily.Metric, 0.001),
            // Weight - USA
            Tuple.Create("Grano (Usa)", "grs", MeasureType.Weight, MeasureFamily.USA, 0.064799),
            Tuple.Create("Dramma (Usa)", "dr", MeasureType.Weight, MeasureFamily.USA, 1.7718),
            Tuple.Create("Libbra (Usa)", "lb", MeasureType.Weight, MeasureFamily.USA, 453.59237),
            Tuple.Create("Oncia (Usa)", "oz", MeasureType.Weight, MeasureFamily.USA, 28.349523),
            // Weight - UK
            Tuple.Create("Grano (Uk)", "grs", MeasureType.Weight, MeasureFamily.UK, 0.064799),
            Tuple.Create("Dramma (Uk)", "dr", MeasureType.Weight, MeasureFamily.UK, 3.89),
            Tuple.Create("Libbra (Uk)", "lb", MeasureType.Weight, MeasureFamily.UK, 453.59237),
            Tuple.Create("Oncia (Uk)", "oz", MeasureType.Weight, MeasureFamily.UK, 28.349523),
            // Weight - Metric
            Tuple.Create("Grammi", "gr", MeasureType.Weight, MeasureFamily.Metric, 1.0),
            Tuple.Create("Centigrammi", "cg", MeasureType.Weight, MeasureFamily.Metric, 0.01),
            Tuple.Create("Chilogrammi", "kg", MeasureType.Weight, MeasureFamily.Metric, 1000.0),
            Tuple.Create("Decigrammi", "dg", MeasureType.Weight, MeasureFamily.Metric, 0.1),
            Tuple.Create("Milligrammi", "mg", MeasureType.Weight, MeasureFamily.Metric, 0.001)
        };

        static readonly Tuple<string, string, string, string, string>[] DefaultShops = new[]
        {
            Tuple.Create("Carrefour Canevari", "Via Canevari", "Genova (GE)", "Sempre aperto...", "010123456"),
            Tuple.Create("Discount Caperana", "Via Piacenza 123", "Chiavari (GE)", "Aperto la mattina", "0123"),
            Tuple.Create("Ipercoop Carasco", "Via Mulinetti 5", "Carasco (SV)", "Martedì a Venerdì dalle 9 alle 20", "018535571"),
            Tuple.Create("Ipercoop Savona", "Corso Ricci, 203r", "Savona (SV)", "Martedì a Sabato dalle 9 alle 21", "019.84061")                                    
        };

        static readonly Tuple<string, string, ShopRating>[] DefaultIngredientShopRatings = new[]
        {
            // Carrefour Canevari
            Tuple.Create("Carrefour Canevari", "Acqua", ShopRating.Bad),
            Tuple.Create("Carrefour Canevari", "Cipolle", ShopRating.Bad), 
            Tuple.Create("Carrefour Canevari", "Farina d'avena", ShopRating.Bad),  
            Tuple.Create("Carrefour Canevari", "Pomodori maturi", ShopRating.Bad),
            Tuple.Create("Carrefour Canevari", "Sale", ShopRating.Bad),
            Tuple.Create("Carrefour Canevari", "Uovo di gallina intero", ShopRating.Bad),
            Tuple.Create("Carrefour Canevari", "Zucchero", ShopRating.Bad),

            // Discount Caperana
            Tuple.Create("Discount Caperana", "Acqua", ShopRating.Good),
            Tuple.Create("Discount Caperana", "Cipolle", ShopRating.Bad), 
            Tuple.Create("Discount Caperana", "Farina d'avena", ShopRating.Bad), 
            Tuple.Create("Discount Caperana", "Pomodori maturi", ShopRating.Bad),
            Tuple.Create("Discount Caperana", "Sale", ShopRating.Good),
            Tuple.Create("Discount Caperana", "Uovo di gallina intero", ShopRating.Bad),
            Tuple.Create("Discount Caperana", "Zucchero", ShopRating.Good),

            // Ipercoop Carasco
            Tuple.Create("Ipercoop Carasco", "Acqua", ShopRating.Good),
            Tuple.Create("Ipercoop Carasco", "Cipolle", ShopRating.Good), 
            Tuple.Create("Ipercoop Carasco", "Farina d'avena", ShopRating.Good), 
            Tuple.Create("Ipercoop Carasco", "Pomodori maturi", ShopRating.Bad),
            Tuple.Create("Ipercoop Carasco", "Sale", ShopRating.Good),
            Tuple.Create("Ipercoop Carasco", "Uovo di gallina intero", ShopRating.Bad),
            Tuple.Create("Ipercoop Carasco", "Zucchero", ShopRating.Good),
            
            // Ipercoop Savona
            Tuple.Create("Ipercoop Savona", "Acqua", ShopRating.Good),
            Tuple.Create("Ipercoop Savona", "Cipolle", ShopRating.Good), 
            Tuple.Create("Ipercoop Savona", "Farina d'avena", ShopRating.Good),  
            Tuple.Create("Ipercoop Savona", "Pomodori maturi", ShopRating.Good),
            Tuple.Create("Ipercoop Savona", "Sale", ShopRating.Good),
            Tuple.Create("Ipercoop Savona", "Uovo di gallina intero", ShopRating.Good),
            Tuple.Create("Ipercoop Savona", "Zucchero", ShopRating.Good)
        };

        public static void LoadDatabase()
        {
            LoadMeasures();
            LoadCategories();
            LoadIngredients();
            LoadShops();
            LoadRecipes();
            LoadGuests();
            LoadEvents();
        }

        static void LoadCategories()
        {
            foreach (var ct in DefaultCategories)
            {
                var c = Manager.Categories.Add(ct.Item1);
                foreach (var parent in ct.Item2)
                    c.Parents.Add(parent);
            }
        }

        static void LoadEvents()
        {
            foreach (var e in DefaultEvents)
            {
                Manager.Events.Add(e.Item1, e.Item2, e.Item3);
            }
        }

        static void LoadGuests()
        {
            var g1 = Manager.Guests.Add("Me medesimo :)", "Piccola descrizione di me stesso!");
            
            var g2 = Manager.Guests.Add("Un mio amico", "Difetti e pregi del mio amico...");
            g1.GuestRatings.Add(g2.Name, GuestRating.VeryGood);
            
            var g3 = Manager.Guests.Add("Una mia amica", "Difetti e pregi della mia amica...");
            g1.GuestRatings.Add(g3.Name, GuestRating.VeryGood);

            var g4 = Manager.Guests.Add("Un mio parente caro", "Difetti e pregi del mio parente...");
            g1.GuestRelationships.Add(g4.Name);

            var g5 = Manager.Guests.Add("Una persona antipatica", "Difetti di quella persona!");
            g1.GuestRatings.Add(g5.Name, GuestRating.VeryBad);
        }

        static void LoadIngredients()
        {
            Array.Sort(DefaultIngredients, new IngredientTupleComparer());
            foreach (var it in DefaultIngredients)
            {
                var i = Manager.Ingredients.Add(it.Item1, it.Item2, DefaultMeasureName(it.Item2));
                foreach (var category in it.Item3)
                    i.Categories.Add(category);
            }
        }

        static void LoadMeasures()
        {
            foreach (var mt in DefaultMeasures)
                Manager.Measures.Add(mt.Item1, mt.Item2, mt.Item3, mt.Item4, mt.Item5);
        }

        static void LoadRecipes()
        {
            var r = Manager.Recipes.Add("Passata di pomodoro", "Giallo Zafferano", MeasureFamily.Metric, 2, 0);
            r.Ingredients.Add("Basilico", "Quanto Basta", 1);
            r.Ingredients.Add("Pomodori maturi", "Chilogrammi", 2, "Tipo San Marzano");
            r.Steps.AddGeneric("Controllare i pomodori uno ad uno, eliminando quelli marci, macchiati o ammaccati");
            r.Steps.AddGeneric("Eliminare i piccioli e lavare molto bene i pomodori; quindi, asciugarli", "Lavandino");
            r.Steps.AddGeneric("Tagliare a metà ogni pomodoro e eliminare i semi", "Coltello");
            r.Steps.AddGeneric("Porre i pomodori tagliati in una grande pentola e lasciar appassire a fuoco basso coprendoli con un coperchio, girandoli di tanto in tanto, finché si saranno afflosciati e spappolati", "Pentola grande");
            r.Steps.AddGeneric("Passare i pomodori spappolati con il passaverdura facendo convergere il sugo in una pentola d'acciaio più piccola", "Passaverdura, pentola piccola");
            r.Trials.Add("Ho provato senza pomodori, chissà perché non viene!");
            r.Trials.Add("Ah, ok, con i pomodori viene bene :P");
            r.MakeOriginal();

            r = Manager.Recipes.Add("Risotto al pomodoro", "HMSoft Cookers", MeasureFamily.Metric, 0, 30, 5);
            r.Ingredients.Add("Riso brillato", "Grammi", 500, "Riso del dr. Scotti!");
            r.Steps.AddSubRecipe("Passata di pomodoro", 5);
            r.Steps.AddGeneric("Far bollire il riso", "Stufa", 0, 15);
            r.Steps.AddGeneric("Scaldare salsa e riso", "Stufa", 0, 5);
            r.Trials.Add("Senza il riso del dr. Scotti non è la stessa cosa...");
            r.MakeOriginal();

            r = Manager.Recipes.Add("Budino alla vaniglia", "Giallo Zafferano", MeasureFamily.Metric, 4, 20, 4);
            r.Ingredients.Add("Colla di pesce", "Grammi", 9);
            r.Ingredients.Add("Uovo di gallina: tuorlo", "Unità", 4, "Freschissimi!");
            r.Ingredients.Add("Vaniglia", "Unità", 1, "Bacca");
            r.Ingredients.Add("Latte di vacca intero", "Millilitri", 350);
            r.Ingredients.Add("Panna", "Millilitri", 200);
            r.Ingredients.Add("Zucchero", "Grammi", 100);
            r.Steps.AddGeneric("Mettere i fogli di gelatina ad ammoribidire in una ciotola con acqua fredda per 15 minuti", "", 0, 15);
            r.Steps.AddGeneric("Incidere il baccello di vaniglia a metà e prelevarne i semini aiutandovi con il coltello", "Coltello");
            r.Steps.AddGeneric("Versare in un tegame latte e panna e aggiungere il baccello di vaniglia e i semini", "Tegame");
            r.Steps.AddGeneric("Mettere sul fuoco il tegame e portare lentamente gli ingredienti a sfiorare l'ebolizione");
            r.Steps.AddGeneric("Spegnere il fuoco e filtrare il composto in una ciotola per eliminare il baccello e gli eventuali residui");
            r.Steps.AddGeneric("Unire quindi i fogli di gelatina, ben strizzati, e mescolate fino a scioglierli completamente");
            r.Steps.AddGeneric("In una ciotola dai bordi alti versare i tuorli e lo zucchero", "Ciotola dai bordi alti");
            r.Steps.AddGeneric("Amalgamare il tutto con l'aiuto di una frusta e quindi unire, sempre mescolando, il composto liquido di latte e panna", "Frusta");
            r.Steps.AddGeneric("Mettere il composto ottenuto in uno stampo e far raffreddare in frigo per almeno 4 ore prima di servire", "Stampo, frigorifero", 4, 0);
            r.Trials.Add("Occorre farlo raffreddare per almeno 4 ore!");
            r.MakeOriginal();

            r = Manager.Recipes.Add("Spuma di fragole", "Vecchi libri della nonna", MeasureFamily.USA, 0, 20, 2);
            r.Ingredients.Add("Uovo di gallina: albume", "Unità", 1);
            r.Ingredients.Add("Fragole", "Tazza", 1);
            r.Ingredients.Add("Zucchero", "Cucchiaio", 2);
            r.Steps.AddGeneric("Pulire, lavare e schiacciare le fragole");
            r.Steps.AddGeneric("Mescolare le fragole con lo zucchero");
            r.Steps.AddGeneric("Unire il bianco d'uovo con il composto");
            r.Steps.AddGeneric("Sbattere il composto con una frusta o frullino finché avrà la consistenza della panna montata", "Frusta o frullino");
            r.Trials.Add("Viene bene subito, è buonissima!");
            r.MakeOriginal();

            r = Manager.Recipes.Add("Budino goloso", "HMSoft Cookers", MeasureFamily.Metric, 4, 50, 4);
            r.Steps.AddSubRecipe("Budino alla vaniglia", 4);
            r.Steps.AddSubRecipe("Spuma di fragole", 4);
            r.Steps.AddGeneric("Mettere la spuma sopra il budino");
            r.Trials.Add("Non mangiare la spuma prima di metterla sul budino!");
            r.MakeOriginal();
        }

        static void LoadShops()
        {
            foreach (var t in DefaultShops)
                Manager.Shops.Add(t.Item1, t.Item2, t.Item3, t.Item4, t.Item5);
            foreach (var t in DefaultIngredientShopRatings)
                Manager.Shops[t.Item1].IngredientRatings.Add(t.Item2, t.Item3);
        }

        static string DefaultMeasureName(MeasureType type)
        {
            switch (type)
            {
                case MeasureType.Unit:
                    return "unità";
                case MeasureType.Volume:
                    return "litri";
                case MeasureType.Weight:
                    return "grammi";
                default:
                    throw new Exception("Internal error");
            }
        }

        sealed class IngredientTupleComparer : IComparer<Tuple<string, MeasureType, string[]>>
        {
            public int Compare(Tuple<string, MeasureType, string[]> x, Tuple<string, MeasureType, string[]> y)
            {
                return string.CompareOrdinal(x.Item1, y.Item1);
            }
        }
    }
}
